home *** CD-ROM | disk | FTP | other *** search
/ Guide To Cracking 2002 / Guide_to_Cracking_2002.iso / Tutorials / Nag and Time Trial / nag / ns64.txt < prev    next >
Encoding:
Text File  |  2000-07-16  |  18.4 KB  |  436 lines

  1.                           Another C4N Tutorial
  2.  
  3.  
  4. Flu[X] Tutor #9
  5. Author: Flu[X]
  6. Date: Sometime in 2000
  7.  
  8. Materials Required:
  9. W32Dasm v8.7+
  10. Brain
  11. 1Way v1.5 (www.atma-software.com)
  12. Hiew 5.65+
  13.  
  14.  
  15. Overview:
  16.  
  17.  Many Crackers have heard of Component Registration systems like VBOX.
  18. The program author pays for a protection scheme for his program. This
  19. same scheme is sold over and over. If you can crack the scheme, you
  20. have effectively cracked EVERY program it protects. So if one scheme
  21. is used to protect 100 products, then crack the scheme, and you have
  22. basically cracked 100 programs by making 1 crack.
  23.  This tutorial deals with such a scheme. Remember this is a tutor for
  24. newbies so i didnt pick an absurdly hard target.
  25.  
  26.  
  27. Brief Techincal Description of 1Way:
  28.  
  29.  Upon installing this package I notice it is a DLL. Linking the DLL
  30. into your program incorporates its protection when you call certain
  31. functions it provides. So if we replace a cracked DLL with the one
  32. the program expects to recieve, we have cracked the program!
  33. Below is the functions it provides:
  34. NOTE: THE IMPORTANT ONES HAVE BEEN STARED (*)
  35.  
  36.  
  37. (*)SharewareLimit:  Handles the whole logic for time-limitation in one step 
  38. SharewareReg:       Registers a trial version 
  39. AppSetup:           Sets up an application 
  40. AppRemove:          Removes an application 
  41. (*)AppDaysLeft:     Returns number of days left in evaluation period 
  42. AppIsSetup:         Application set up or not 
  43. AppIsExpired:       Trial period expired or not 
  44. (*)AppIsRegistered: Application registered or not 
  45. DateIsSetBack:      System Date has been set back or not 
  46. GetCDriveSerial:    Returns serial number of the C: drive 
  47.  
  48. Obviously SharewareLimit is one function to crack because it handles
  49. the entire is registered process in one step. Also AppIsRegistered is
  50. important because if a programmer calls this it will tell him if it
  51. is registered or not yet. Third, AppDaysLeft is important for programs
  52. that do not offer registration but just time out and are no longer
  53. useable.
  54.  
  55. There is also a shareware nag that tends to get annoying so we
  56. will remove that as well.
  57.  
  58. Fire up W32Dasm and rip up 1way.dll
  59.  
  60. ===Removing the Nag====
  61.  
  62.  
  63. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  64. |:4000BCE9(C)
  65. |
  66. :4000BCF1 83FB09                  cmp ebx, 00000009         <-if ebx is > 9 goto nag
  67. :4000BCF4 7F11                    jg 4000BD07
  68. :4000BCF6 833DE4F2004009          cmp dword ptr [4000F2E4], 00000009 <if data at mem loc is >9 goto nag
  69. :4000BCFD 7F08                    jg 4000BD07
  70. :4000BCFF 3B1DE4F20040            cmp ebx, dword ptr [4000F2E4] <- ebx > data at mem loc ??
  71. :4000BD05 7D25                    jge 4000BD2C      <-jump past nag
  72.  
  73. * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  74. |:4000BCF4(C), :4000BCFD(C)
  75. |
  76. :4000BD07 33DB                    xor ebx, ebx
  77. :4000BD09 33C0                    xor eax, eax
  78. :4000BD0B A3E4F20040              mov dword ptr [4000F2E4], eax
  79. :4000BD10 6830100000              push 00001030
  80.  
  81. * Possible StringData Ref from Code Obj ->"1Way.DLL - Evaluation version"
  82.                                   |
  83. :4000BD15 68C4BD0040              push 4000BDC4
  84.  
  85. * Possible StringData Ref from Code Obj ->"This version is for evaluation "
  86.                                         ->"purposes only."
  87.                                   |
  88. :4000BD1A 68E4BD0040              push 4000BDE4
  89. :4000BD1F A148F30040              mov eax, dword ptr [4000F348]
  90. :4000BD24 8B00                    mov eax, dword ptr [eax]
  91. :4000BD26 50                      push eax
  92.  
  93. * Reference To: user32.MessageBoxA, Ord:0000h
  94.                                   |
  95. :4000BD27 E80492FFFF              Call 40004F30
  96.  
  97. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  98. |:4000BD05(C)
  99.  
  100. :4000BD2C
  101.  
  102.  
  103. Explanation of above:
  104.  All this section does is test a few circumstances generated, and if
  105. they are met it shows the nag.. you can crack this by the modification
  106. shown below.
  107.  
  108.  
  109. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  110. |:4000BCE9(C)
  111. |
  112. :4000BCF1 83FB09                  cmp ebx, 00000009         <-if ebx is > 9 goto nag
  113. :4000BCF4 7F11                    jg 4000BD07
  114. :4000BCF6 833DE4F2004009          cmp dword ptr [4000F2E4], 00000009 <if data at mem loc is >9 goto nag
  115. :4000BCFD 7F08                    jg 4000BD07
  116. :4000BCFF 3B1DE4F20040            cmp ebx, dword ptr [4000F2E4] <- ebx > data at mem loc ??
  117. :4000BD05 7D25                    jge 4000BD2C      <-jump past nag if condition met
  118.  
  119.                                      BECOMES
  120.  
  121. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  122. |:4000BCE9(C)
  123. |
  124. :4000BCF1 83FB09                  cmp ebx, 00000009         <-if ebx is > 9 then nothing!
  125. :4000BCF4 90                      nop
  126. :4000BCF5 90                      nop
  127. :4000BCF6 833DE4F2004009          cmp dword ptr [4000F2E4], 00000009 <if data at mem loc is >9 nothing!
  128. :4000BCFD 90                      nop
  129. :4000BCFE 90                      nop
  130. :4000BCFF 3B1DE4F20040            cmp ebx, dword ptr [4000F2E4] <- ebx > data at mem loc ??
  131. :4000BD05 EB25                    jmp 4000BD2C      <-jump past nag ALWAYS
  132.  
  133.  
  134. All that was done was the removal of the code to jump to the nag!
  135. Now It wont display that annoying nag anymore!
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144. ==Cracking the SharewareLimit Function==
  145.  
  146. Exported fn(): SharewareLimit - Ord:000Ah
  147. :4000E394 55                      push ebp
  148. :4000E395 8BEC                    mov ebp, esp
  149. :4000E397 53                      push ebx
  150. :4000E398 56                      push esi
  151. :4000E399 8B750C                  mov esi, dword ptr [ebp+0C]
  152. :4000E39C 8B5D08                  mov ebx, dword ptr [ebp+08]
  153. :4000E39F 56                      push esi
  154. :4000E3A0 53                      push ebx
  155. * Reference To: OneWay.AppIsExpired
  156.                                   |
  157. :4000E3A1 E85AF7FFFF              call 4000DB00 <- Call to see if app is expired
  158. :4000E3A6 84C0                    test al, al   <-test to see if it is
  159. :4000E3A8 742C                    je 4000E3D6   <- if app is NOT expired, Jump to continue
  160. :4000E3AA 56                      push esi
  161. :4000E3AB 53                      push ebx
  162.  
  163.  
  164. Now this is pretty simple, making it always jump to the non-expired
  165. code no matter what AppIsExpired returns will crack this function!
  166.  
  167. Below are the modifications:
  168.  
  169.  
  170. * Reference To: OneWay.AppIsExpired
  171.                                   |
  172. :4000E3A1 E85AF7FFFF              call 4000DB00
  173. :4000E3A6 84C0                    test al, al
  174. :4000E3A8 EB2C                    jmp 4000E3D6 <- Always jump to good Code!!
  175. :4000E3AA 56                      push esi
  176. :4000E3AB 53                      push ebx
  177. * Reference To: OneWay.AppIsSetup
  178.  
  179. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  180. |:4000E3A8(U)
  181. |
  182. :4000E3D6 33C0                    xor eax, eax  <- good code (clear eax being used as a flag)
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190. ===Cracking the AppDaysLeft Function===
  191.  
  192. Exported fn(): AppDaysLeft - Ord:0005h
  193. :4000DCC8 55                      push ebp
  194. :4000DCC9 8BEC                    mov ebp, esp
  195. :4000DCCB 53                      push ebx
  196. :4000DCCC E843DFFFFF              call 4000BC14
  197. :4000DCD1 83CBFF                  or ebx, FFFFFFFF
  198. :4000DCD4 8B450C                  mov eax, dword ptr [ebp+0C]
  199. :4000DCD7 50                      push eax
  200. :4000DCD8 8B4508                  mov eax, dword ptr [ebp+08]
  201. :4000DCDB 50                      push eax
  202. * Reference To: OneWay.AppIsExpired
  203.                                   |
  204. :4000DCDC E81FFEFFFF              call 4000DB00 <- Get expiration Time
  205. :4000DCE1 84C0                    test al, al   <-Is expired
  206. :4000DCE3 7523                    jne 4000DD08  <- if yes send back no more days left in trial
  207. :4000DCE5 B81C070140              mov eax, 4001071C
  208. :4000DCEA BA10DD0040              mov edx, 4000DD10
  209. :4000DCEF 33C9                    xor ecx, ecx
  210. :4000DCF1 8A08                    mov cl, byte ptr [eax]
  211. :4000DCF3 41                      inc ecx
  212. :4000DCF4 E8BB4AFFFF              call 400027B4 <-get # of days left
  213. :4000DCF9 7506                    jne 4000DD01 <-if not registered goto here
  214. :4000DCFB 66BB0F27                mov bx, 270F
  215. :4000DCFF EB07                    jmp 4000DD08
  216.  
  217. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  218. |:4000DCF9(C)
  219. |
  220. :4000DD01 668B1DD0070140          mov bx, word ptr [400107D0] <- Number of days left
  221.  
  222. * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  223. |:4000DCE3(C), :4000DCFF(U)
  224. |
  225. :4000DD08 8BC3                    mov eax, ebx
  226. :4000DD0A 5B                      pop ebx
  227. :4000DD0B 5D                      pop ebp
  228. :4000DD0C C20800                  ret 0008
  229.  
  230.  
  231. Ok, pretty simple, this can be fixed by the modifications being made below
  232.  
  233.  
  234. * Reference To: OneWay.AppIsExpired
  235.                                   |
  236. :4000DCDC E81FFEFFFF              call 4000DB00 <- Get expiration Time
  237. :4000DCE1 84C0                    test al, al   <- Is Expired??
  238. :4000DCE3 90                      nop           <- changed to nop so it will Never JUMP 
  239. :4000DCE4 90                      nop           <- to we are expired!
  240. :4000DCE5 B81C070140              mov eax, 4001071C
  241. :4000DCEA BA10DD0040              mov edx, 4000DD10
  242. :4000DCEF 33C9                    xor ecx, ecx
  243. :4000DCF1 8A08                    mov cl, byte ptr [eax]
  244. :4000DCF3 41                      inc ecx
  245. :4000DCF4 E8BB4AFFFF              call 400027B4 <-days left 
  246. :4000DCF9 EB06                    jmp 4000DD01  <-always jump to set days left
  247. :4000DCFB 66BB0F27                mov bx, 270F
  248. :4000DCFF EB07                    jmp 4000DD08
  249.  
  250. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  251. |:4000DCF9(U)
  252. |
  253. :4000DD01 66BB4500                mov bx, 0045 <-move 45h into # of days left (45h= 69)
  254. :4000DD05 40                      inc eax      <-fill bytes that new instruction does not use
  255. :4000DD06 90                      nop          <
  256. :4000DD07 48                      dec eax      <
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264. ===Cracking the AppIsRegistered Function===
  265.  
  266. Exported fn(): AppIsRegistered - Ord:0007h
  267. :4000DD14 55                      push ebp
  268. :4000DD15 8BEC                    mov ebp, esp
  269. :4000DD17 6A00                    push 00000000
  270. :4000DD19 6A00                    push 00000000
  271. :4000DD1B 53                      push ebx
  272. :4000DD1C 33C0                    xor eax, eax
  273. :4000DD1E 55                      push ebp
  274. :4000DD1F 68E4DD0040              push 4000DDE4
  275. :4000DD24 64FF30                  push dword ptr fs:[eax]
  276. :4000DD27 648920                  mov dword ptr fs:[eax], esp
  277. :4000DD2A E8E5DEFFFF              call 4000BC14
  278. :4000DD2F 33DB                    xor ebx, ebx
  279. :4000DD31 8D55FC                  lea edx, dword ptr [ebp-04]
  280. :4000DD34 8B450C                  mov eax, dword ptr [ebp+0C]
  281. :4000DD37 E8E081FFFF              call 40005F1C
  282. :4000DD3C 8B45FC                  mov eax, dword ptr [ebp-04]
  283. :4000DD3F 50                      push eax
  284. :4000DD40 8D55F8                  lea edx, dword ptr [ebp-08]
  285. :4000DD43 8B4508                  mov eax, dword ptr [ebp+08]
  286. :4000DD46 E8D181FFFF              call 40005F1C
  287. :4000DD4B 8B45F8                  mov eax, dword ptr [ebp-08]
  288. :4000DD4E 5A                      pop edx
  289. :4000DD4F E864EEFFFF              call 4000CBB8 <-get conditions
  290. :4000DD54 84C0                    test al, al <-test if not conditions met
  291. :4000DD56 7471                    je 4000DDC9 <- jump if not good condition so app will be unregistered
  292. :4000DD58 E827E9FFFF              call 4000C684
  293. :4000DD5D 8D45FC                  lea eax, dword ptr [ebp-04]
  294. :4000DD60 BAD8060140              mov edx, 400106D8
  295. :4000DD65 E88257FFFF              call 400034EC
  296. :4000DD6A 8B45FC                  mov eax, dword ptr [ebp-04]
  297. :4000DD6D E8DEE1FFFF              call 4000BF50
  298. :4000DD72 B81C070140              mov eax, 4001071C
  299. :4000DD77 BAF4DD0040              mov edx, 4000DDF4
  300. :4000DD7C 33C9                    xor ecx, ecx
  301. :4000DD7E 8A08                    mov cl, byte ptr [eax]
  302. :4000DD80 41                      inc ecx
  303. :4000DD81 E82E4AFFFF              call 400027B4 <-get conditions and test them
  304. :4000DD86 7541                    jne 4000DDC9 <- jump if not good condition so app will be unregistered
  305. :4000DD88 8D45FC                  lea eax, dword ptr [ebp-04]
  306. :4000DD8B BA40070140              mov edx, 40010740
  307. :4000DD90 E85757FFFF              call 400034EC
  308. :4000DD95 8B45FC                  mov eax, dword ptr [ebp-04]
  309. :4000DD98 50                      push eax
  310. * Reference To: OneWay.GetCDriveSerial
  311.                                   |
  312. :4000DD99 E8F6F7FFFF              call 4000D594
  313. :4000DD9E 8D55F8                  lea edx, dword ptr [ebp-08]
  314. :4000DDA1 E8127DFFFF              call 40005AB8
  315. :4000DDA6 8B55F8                  mov edx, dword ptr [ebp-08]
  316. :4000DDA9 58                      pop eax
  317. :4000DDAA E8A958FFFF              call 40003658    <-call for certain circumstances
  318. :4000DDAF 7518                    jne 4000DDC9     <- jump if not good condition so app will be unregistered
  319. :4000DDB1 B864070140              mov eax, 40010764
  320. :4000DDB6 BAECF20040              mov edx, 4000F2EC
  321. :4000DDBB 33C9                    xor ecx, ecx
  322. :4000DDBD 8A08                    mov cl, byte ptr [eax]
  323. :4000DDBF 41                      inc ecx
  324. :4000DDC0 E8EF49FFFF              call 400027B4 <-call for certain circumstances
  325. :4000DDC5 7502                    jne 4000DDC9 <- jump if not good condition so app will be unregistered
  326. :4000DDC7 B301                    mov bl, 01 <- set is registered
  327.  
  328. * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  329. |:4000DD56(C), :4000DD86(C), :4000DDAF(C), :4000DDC5(C)
  330. |
  331. :4000DDC9 33C0                    xor eax, eax
  332. :4000DDCB 5A                      pop edx
  333. :4000DDCC 59                      pop ecx
  334. :4000DDCD 59                      pop ecx
  335. :4000DDCE 648910                  mov dword ptr fs:[eax], edx
  336. :4000DDD1 68EBDD0040              push 4000DDEB
  337.  
  338.  
  339. As you can see at location 4000DDC7, if bl is set to 1 then the
  340. DLL will return that it is registered. All the jumps jump past
  341. this line of code making the application be unregistered. By Nopping
  342. out the jumps we can simply make it always run a mov of 1 into bl
  343. making the application registered!
  344.  
  345. Below are the changes that need to be made:
  346.  
  347.  
  348. Exported fn(): AppIsRegistered - Ord:0007h
  349. :4000DD14 55                      push ebp
  350. :4000DD15 8BEC                    mov ebp, esp
  351. :4000DD17 6A00                    push 00000000
  352. :4000DD19 6A00                    push 00000000
  353. :4000DD1B 53                      push ebx
  354. :4000DD1C 33C0                    xor eax, eax
  355. :4000DD1E 55                      push ebp
  356. :4000DD1F 68E4DD0040              push 4000DDE4
  357. :4000DD24 64FF30                  push dword ptr fs:[eax]
  358. :4000DD27 648920                  mov dword ptr fs:[eax], esp
  359. :4000DD2A E8E5DEFFFF              call 4000BC14
  360. :4000DD2F 33DB                    xor ebx, ebx
  361. :4000DD31 8D55FC                  lea edx, dword ptr [ebp-04]
  362. :4000DD34 8B450C                  mov eax, dword ptr [ebp+0C]
  363. :4000DD37 E8E081FFFF              call 40005F1C
  364. :4000DD3C 8B45FC                  mov eax, dword ptr [ebp-04]
  365. :4000DD3F 50                      push eax
  366. :4000DD40 8D55F8                  lea edx, dword ptr [ebp-08]
  367. :4000DD43 8B4508                  mov eax, dword ptr [ebp+08]
  368. :4000DD46 E8D181FFFF              call 40005F1C
  369. :4000DD4B 8B45F8                  mov eax, dword ptr [ebp-08]
  370. :4000DD4E 5A                      pop edx
  371. :4000DD4F E864EEFFFF              call 4000CBB8
  372. :4000DD54 84C0                    test al, al
  373. :4000DD56 40                      inc eax         <- inc eax and dex eax used in a pair 
  374. :4000DD57 48                      dec eax         <- are the same as two nops
  375. :4000DD58 E827E9FFFF              call 4000C684
  376. :4000DD5D 8D45FC                  lea eax, dword ptr [ebp-04]
  377. :4000DD60 BAD8060140              mov edx, 400106D8
  378. :4000DD65 E88257FFFF              call 400034EC
  379. :4000DD6A 8B45FC                  mov eax, dword ptr [ebp-04]
  380. :4000DD6D E8DEE1FFFF              call 4000BF50
  381. :4000DD72 B81C070140              mov eax, 4001071C
  382. :4000DD77 BAF4DD0040              mov edx, 4000DDF4
  383. :4000DD7C 33C9                    xor ecx, ecx
  384. :4000DD7E 8A08                    mov cl, byte ptr [eax]
  385. :4000DD80 41                      inc ecx
  386. :4000DD81 E82E4AFFFF              call 400027B4
  387. :4000DD86 41                      inc ecx         <- inc ecx and dec ecx used in a pair
  388. :4000DD87 49                      dec ecx         <- are the same as two nops
  389. :4000DD88 8D45FC                  lea eax, dword ptr [ebp-04]
  390. :4000DD8B BA40070140              mov edx, 40010740
  391. :4000DD90 E85757FFFF              call 400034EC
  392. :4000DD95 8B45FC                  mov eax, dword ptr [ebp-04]
  393. :4000DD98 50                      push eax
  394. * Reference To: OneWay.GetCDriveSerial
  395.                                   |
  396. :4000DD99 E8F6F7FFFF              call 4000D594
  397. :4000DD9E 8D55F8                  lea edx, dword ptr [ebp-08]
  398. :4000DDA1 E8127DFFFF              call 40005AB8
  399. :4000DDA6 8B55F8                  mov edx, dword ptr [ebp-08]
  400. :4000DDA9 58                      pop eax
  401. :4000DDAA E8A958FFFF              call 40003658
  402. :4000DDAF 40                      inc eax           <- inc eax and dex eax used in a pair 
  403. :4000DDB0 48                      dec eax           <- are the same as two nops
  404. :4000DDB1 B864070140              mov eax, 40010764
  405. :4000DDB6 BAECF20040              mov edx, 4000F2EC
  406. :4000DDBB 33C9                    xor ecx, ecx
  407. :4000DDBD 8A08                    mov cl, byte ptr [eax]
  408. :4000DDBF 41                      inc ecx
  409. :4000DDC0 E8EF49FFFF              call 400027B4
  410. :4000DDC5 90                      nop                <- nop out jump
  411. :4000DDC6 90                      nop                <- "
  412. :4000DDC7 B301                    mov bl, 01
  413. :4000DDC9 33C0                    xor eax, eax
  414. :4000DDCB 5A                      pop edx
  415. :4000DDCC 59                      pop ecx
  416. :4000DDCD 59                      pop ecx
  417. :4000DDCE 648910                  mov dword ptr fs:[eax], edx
  418. :4000DDD1 68EBDD0040              push 4000DDEB
  419.  
  420.  
  421.  
  422.  
  423. After these modifications We have made we now possess a cracked DLL.
  424. Now if an application is protected by 1Way.dll, all we have to do
  425. is replace the supplied dll with ours and we will have cracked the
  426. program. Pretty Simple Eh?
  427.  
  428. I hope to see you again in Flu[X] tutor #10
  429. As always if you like a program buy it!  This essay is for
  430. educational purposes ONLY! Software authors deserve your support!
  431.  
  432. Flu[X]/C4N 2000
  433. http://tuts99.cjb.net
  434. htp://tuts98m1.cjb.net
  435.  
  436.